JavaScript

A5.u.objectassign Method

Syntax

A5.u.object.assign(object,objectSrc[,keepOriginal[,exclude]])

Arguments

objectobjectarray

The object or array to assign properties to.

objectSrcobjectarray

The object or array to assign properties from.

keepOriginalboolean

Whether or not to keep the original properties (if they exist) in the object being assigned to.

excludearray

An array of paths to exclude from the assignment. The array should consist of string representation of paths like those used in A5.u.object.set and A5.u.object.get (for example "customer[1].name").

Description

Assign the properties from a source object to another object.

Example

var data = {name: 'Bob', age: 54};
var data2 = {name: 'Fred', '_hidden': 'temp'};
A5.u.object.each(data2,data,true,['_hidden']);
// data2 = {name: 'Fred', age: 54}